<template lang="html">
    <div id="temp">
        <div class="mui-content" style="background-color:#fff">

            <ul class="mui-table-view mui-grid-view">
                <li v-for="item in list" style="" class="mui-table-view-cell mui-media mui-col-xs-6">
                    <router-link  v-bind="{to:'/goods/goodsinfo/'+item.id}">
                        <img class="mui-media-object" :src="item.img_url">
                        <div  class="mui-media-body" style="text-align: left;position: relative; height: 40px;">
                            <span style="color: red;text-align: left">￥{{item.sell_price}}</span>
                            <S>￥{{item.market_price}}</S>
                            <p style="position:absolute;left: 0;bottom: 0;">热卖中</p>
                            <p style="position:absolute;right:0;bottom: 0;">剩余{{item.stock_quantity}}件</p>
                        </div>
                    </router-link>
                </li>
            </ul>
        </div>
    </div>
</template>
<script type="text/ecmascript-6">
    export default{
            data(){
                return {
                    list:[]
                }

            },
            created(){
                this.getlist();
            },
            methods:{
                getlist(){
                    var url = 'http://182.254.146.100:8899/api/getgoods/?pageindex=1';
                    this.$http.get(url).then(function(response){
                        var data = response.body;
                        // console.log(data);
//                        if(data.status !=0){
//                            Toast(data.message);
//                            return;
//                        }
                        this.list = data.message;
                    })
                    }
                }


    }
</script>
<style scoped>

</style>